Detection of pain after nociceptive stimulus